package com.hqd.ch03.v51.io.support;

import com.hqd.ch03.v51.core.env.PropertySource;
import com.hqd.ch03.v51.io.PropertySourceFactory;

import java.io.IOException;

public class DefaultPropertySourceFactory implements PropertySourceFactory {

    @Override
    public PropertySource<?> createPropertySource(String name, EncodedResource resource) throws IOException {
        return (name != null ? new ResourcePropertySource(name, resource) : new ResourcePropertySource(resource));
    }

}

